Appendix A: Style override codes
Appendix B: Embedded font/picture encoding This document was SSA’s format specification originally (can be found at http://www.eswat.demon.co.uk). Updates and differences are marked red. |
| !: | This is a comment used in the script file only. It is not visible when you load the script into SSA. |
| Title: | This is a description of the script |
| Original Script: | The original author(s) of the script |
| Original Translation: | (optional) The original translator of the dialogue |
| Original Editing: | (optional) The original script editor(s), typically whoever took the raw translation and turned it into idiomatic english and reworded for readability. |
| Original Timing: | (optional) Whoever timed the original script |
| Synch Point: | (optional) Description of where in the video the script should begin playback. |
| Script Updated By: | (optional) Names of any other subtitling groups who edited the original script. |
| Update Details: | The details of any updates to the original script made by other subtilting groups. |
| ScriptType: | This is the SSA script format version eg. "V3.00". |
| Collisions: | This determines how subtitles are moved, when preventing onscreen collisions |
| PlayResY: | This is the height of the screen used by the authors when playing the script. |
| PlayResX: | This is the width of the screen used by the authors when playing the script. |
| PlayResX: | This is the colour depth used by the authors when playing the script. |
| Timer: | This is the Timer Speed for the script, as a percentage. eg. "100.0000" is exactly 100%. The timer speed is a time multiplier applied to SSA's clock to provide a ramp time. |
| Style: | This is a Style definition, used to format text displayed by the script. |
| Dialogue: | This is a Dialogue event, ie. Some text to display. |
| Comment: | This is a "comment" event. This contains the same information as a Dialogue, Picture, Sound, Movie, or Command event, but it is ignored during script playback. |
| Picture: | This is a "picture" event, which means SSA will display the specified .bmp, .jpg, .gif, .ico or .wmf graphic. |
| Sound: | This is a "sound" event, which means SSA will play the specified .wav file. |
| Movie: | This is a "movie" event, which means SSA will play the specified .avi file. |
| Command: | This is a "command" event, which means SSA will execute the specified program as a background task. |
| ; | Semicolon. Any text can follow the semicolon This is a comment used in the script file only. It is not visible when you load the script into SSA. The semicolon must be the first character in the line. This replaces the !: line type used in previous script versions. |
| Title: | This is a description of the script. If the original author(s) did not provide this information then <untitled> is automatically substituted. |
| Original Script: | The original author(s) of the script. If the original author(s) did not provide this information then <unknown> is automatically substituted. |
| Original Translation: | (optional) The original translator of the dialogue. This entry does not appear if no information was entered by the author. |
| Original Editing: | (optional) The original script editor(s), typically whoever took the raw translation and turned it into idiomatic english and reworded for readability. This entry does not appear if no information was entered by the author. |
| Original Timing: | (optional) Whoever timed the original script. This entry does not appear if no information was entered by the author. |
| Synch Point: | (optional) Description of where in the video the script should begin playback. This entry does not appear if no information was entered by the author. |
| Script Updated By: | (optional) Names of any other subtitling groups who edited the original script. This entry does not appear if subsequent editors did not enter the information. |
| Update Details: | The details of any updates to the original script - made by other subtitling groups. This entry does not appear if subsequent editors did not enter any information. |
| Script Type: | This is the SSA script format version eg. "V4.00". It is used by SSA to give a warning if you are using a version of SSA older than the version that created the script. ASS version is “V4.00+”. |
| Collisions: | This determines how subtitles are moved, when automatically preventing onscreen collisions. If the entry says "Normal" then SSA will attempt to position subtitles in the position specified by the "margins". However, subtitles can be shifted vertically to prevent onscreen collisions. With "normal" collision prevention, the subtitles will "stack up" one above the other - but they will always be positioned as close the vertical (bottom) margin as possible - filling in "gaps" in other subtitles if one large enough is available. If the entry says "Reverse" then subtitles will be shifted upwards to make room for subsequent overlapping subtitles. This means the subtitles can nearly always be read top-down - but it also means that the first subtitle can appear half way up the screen before the subsequent overlapping subtitles appear. It can use a lot of screen area. |
| PlayResY: | This is the height of the screen used by the script's author(s) when playing the script. SSA v4 will automatically select the nearest enabled setting, if you are using Directdraw playback. |
| PlayResX: | This is the width of the screen used by the script's author(s) when playing the script. SSA will automatically select the nearest enabled, setting if you are using Directdraw playback. |
| PlayDepth: | This is the colour depth used by the script's author(s) when playing the script. SSA will automatically select the nearest enabled setting if you are using Directdraw playback. |
| Timer: | This is the Timer Speed for the script, as a percentage. eg. "100.0000" is exactly 100%. It has four digits following the decimal point. The timer speed is a time multiplier applied to SSA's clock to stretch or compress the duration of a script. A speed greater than 100% will reduce the overall duration, and means that subtitles will progressively appear sooner and sooner. A speed less than 100% will increase the overall duration of the script means subtitles will progressively appear later and later (like a positive ramp time). The stretching or compressing only occurs during script playback - this value does not change the actual timings for each event listed in the script. Check the SSA user guide if you want to know why "Timer Speed" is more powerful than "Ramp Time", even though they both achieve the same result. |
| WrapStyle: | Defines the default wrapping style. 0: smart wrapping, lines are evenly broken 1: end-of-line word wrapping, only \N breaks 2: no word wrapping, \n \N both breaks 3: same as 0, but lower line gets wider. |
| Field 1: | Name. The name of the Style. Case sensitive. Cannot include commas. |
| Field 2: | Fontname. The fontname as used by Windows. Case-sensitive. |
| Field 3: | Fontsize. |
| Field 4: | PrimaryColour. A long integer BGR (blue-green-red) value. ie. the byte order in the hexadecimal equivelent of this number is BBGGRR This is the colour that a subtitle will normally appear in. |
| Field 5: | SecondaryColour. A long integer BGR (blue-green-red) value. ie. the byte order in the hexadecimal equivelent of this number is BBGGRR This colour may be used instead of the Primary colour when a subtitle is automatically shifted to prevent an onscreen collsion, to distinguish the different subtitles. |
| Field 6: | OutlineColour This colour may be used instead of the Primary or Secondary colour when a subtitle is automatically shifted to prevent an onscreen collsion, to distinguish the different subtitles. |
| Field 7: | BackColour. This is the colour of the subtitle outline or shadow, if these are used. A long integer BGR (blue-green-red) value. ie. the byte order in the hexadecimal equivelent of this number is BBGGRR. |
| Field 4-7: | The color format contains the alpha channel, too. (AABBGGRR) |
| Field 8: | Bold. This defines whether text is bold (true) or not (false). -1 is True, 0 is False. This is independant of the Italic attribute - you can have have text which is both bold and italic. |
| Field 9: | Italic. This defines whether text is italic (true) or not (false). -1 is True, 0 is False. This is independant of the bold attribute - you can have have text which is both bold and italic. |
| Field 9.1: | Underline. [-1 or 0] |
| Field 9.2: | Strikeout. [-1 or 0] |
| Field 9.3: | ScaleX. Modifies the width of the font. [percent] |
| Field 9.4: | ScaleY. Modifies the height of the font. [percent] |
| Field 9.5: | Spacing. Extra space between characters. [pixels] |
| Field 9.6: | Angle. The origin of the rotation is defined by the alignment. Can be a floating point number. [degrees] |
| Field 10: | BorderStyle. 1=Outline + drop shadow, 3=Opaque box |
| Field 11: | Outline. If BorderStyle is 1, then this specifies the width of the outline around the text, in pixels. Values may be 0, 1, 2, 3 or 4. |
| Field 12: | Shadow. If BorderStyle is 1, then this specifies the depth of the drop shadow behind the text, in pixels. Values may be 0, 1, 2, 3 or 4. Drop shadow is always used in addition to an outline - SSA will force an outline of 1 pixel if no outline width is given. |
| Field 13: | Alignment. This sets how text is "justified" within the Left/Right onscreen margins, and also the vertical placing. Values may be 1=Left, 2=Centered, 3=Right. Add 4 to the value for a "Toptitle". Add 8 to the value for a "Midtitle". eg. 5 = left-justified toptitle |
| Field 13: | Alignment, but after the layout of the numpad (1-3 sub, 4-6 mid, 7-9 top). |
| Field 14: | MarginL. This defines the Left Margin in pixels. It is the distance from the left-hand edge of the screen.The three onscreen margins (MarginL, MarginR, MarginV) define areas in which the subtitle text will be displayed. |
| Field 15: | MarginR. This defines the Right Margin in pixels. It is the distance from the right-hand edge of the screen. The three onscreen margins (MarginL, MarginR, MarginV) define areas in which the subtitle text will be displayed. |
| Field 16: | MarginV. This defines the vertical Left Margin in pixels. For a subtitle, it is the distance from the bottom of the screen. For a toptitle, it is the distance from the top of the screen. For a midtitle, the value is ignored - the text will be vertically centred |
| Field 17: | AlphaLevel. This defines the transparency of the text. SSA does not use this yet. |
| Field 17: | Not present in ASS. |
| Field 18: | Encoding. This specifies the font character set or encoding and on multi-lingual Windows installations it provides access to characters used in multiple than one languages. It is usually 0 (zero) for English (Western, ANSI) Windows. When the file is Unicode, this field is useful during file format conversions. |
| Field 1: | Marked Marked=0 means the line is not shown as "marked" in SSA. Marked=1 means the line is shown as "marked" in SSA. |
| Field 1: | Layer (any integer) Subtitles having different layer number will be ignored during the collusion detection. Higher numbered layers will be drawn over the lower numbered. |
| Field 2: | Start Start Time of the Event, in 0:00:00:00 format ie. Hrs:Mins:Secs:hundredths. This is the time elapsed during script playback at which the text will appear onscreen. Note that there is a single digit for the hours! |
| Field 3: | End End Time of the Event, in 0:00:00:00 format ie. Hrs:Mins:Secs:hundredths. This is the time elapsed during script playback at which the text will disappear offscreen. Note that there is a single digit for the hours! |
| Field 4: | Style Style name. If it is "Default", then your own *Default style will be subtituted. However, the Default style used by the script author IS stored in the script even though SSA ignores it - so if you want to use it, the information is there - you could even change the Name in the Style definition line, so that it will appear in the list of "script" styles. |
| Field 5: | Name Character name. This is the name of the character who speaks the dialogue. It is for information only, to make the script is easier to follow when editing/timing. |
| Field 6: | MarginL 4-figure Left Margin override. The values are in pixels. All zeroes means the default margins defined by the style are used. |
| Field 7: | MarginR 4-figure Right Margin override. The values are in pixels. All zeroes means the default margins defined by the style are used. |
| Field 8: | MarginV 4-figure Bottom Margin override. The values are in pixels. All zeroes means the default margins defined by the style are used. |
| Field 9: | Effect Transition Effect. This is either empty, or contains information for one of the three transition effects implemented in SSA v4.x The effect names are case sensitive and must appear exactly as shown. The effect names do not have quote marks around them. "Karaoke" means that the text will be successively highlighted one word at a time. Karaoke as an effect type is obsolete. "Scroll up;y1;y2;delay[;fadeawayheight]" means that the text/picture will scroll up the screen. The parameters after the words "Scroll up" are separated by semicolons. The y1 and y2 values define a vertical region on the screen in which the text will scroll. The values are in pixels, and it doesn't matter which value (top or bottom) comes first. If the values are zeroes then the text will scroll up the full height of the screen. The delay value can be a number from 1 to 100, and it slows down the speed of the scrolling - zero means no delay and the scrolling will be as fast as possible. “Banner;delay” means that text will be forced into a single line, regardless of length, and scrolled from right to left accross the screen. The delay value can be a number from 1 to 100, and it slows down the speed of the scrolling - zero means no delay and the scrolling will be as fast as possible. "Scroll down;y1;y2;delay[;fadeawayheight]" “Banner;delay[;lefttoright;fadeawaywidth]” lefttoright 0 or 1. This field is optional. Default value is 0 to make it backwards compatible. When delay is greater than 0, moving one pixel will take (1000/delay) second. (WARNING: Avery Lee’s “subtitler” plugin reads the “Scroll up” effect parameters as delay;y1;y2) fadeawayheight and fadeawaywidth parameters can be used to make the scrolling text at the sides transparent. |
| Field 10: | Text Subtitle Text. This is the actual text which will be displayed as a subtitle onscreen. Everything after the 9th comma is treated as the subtitle text, so it can include commas. The text can include \n codes which is a line break, and can include Style Override control codes, which appear between braces { }. |
| \n | New line (carriage return) \n is ignored by SSA if “smart-wrapping” is enabled eg. This is the first line\nand this is the second |
| \N | New line (carriage return). This is used by SSA instead of \n if “smart-wrapping” is enabled. |
| \b<0 or 1> | \b1 makes the text bold. \b0 forces non-bold text. eg. There is a {\b1}bold {\b0}word here When this parameter is greater than 1, it will be used as the weight of the font. (400 = Normal, 700 = Bold, note: most fonts will quantize to 2 or 3 levels of thickness) |
| \i<0 or 1> | \i1 makes the text italic. \i0 forces non-italic text. eg. There is an {\i1}italicised {\i0}word here |
| \u<0 or 1> | underline |
| \s<0 or 1> | strikeout |
| \bord<width> | border |
| \shad<depth> | shadow |
| \be<0 or 1> | blur edges |
| \fn<font name> | <font name> specifies a font which you have installed in Windows. This is case sensitive. eg. Here is some {\fnCourier New}fixed space text If you use a font name that doesn't exist, then Arial will be used instead. |
| \fs<font size> | <font size> is a number specifying a font point size. eg. {\fs16}This is small text. {\fs28}This is large text |
| \fsc<x or y><percent> | <x or y> x scales horizontally, y scales vertically <percent> defines size |
| \fsp<pixels> | <pixels> changes the distance between letters. (default: 0) |
| \fr[<x/y/z>]<degree> | <degrees> sets the rotation angle around the x/y/z axis. \fr defaults to \frz. |
| \fe<charset> | <charset> is a number specifying the character set (font encoding) |
| \c&H<bbggrr>& | <bbggrr> is a hexadecimal RGB value, but in reverse order. Leading zeroes are not required. {\c&HFF&}This would be pure, full intensity red {\c&HFF00&}This would be pure, full intensity green {\c&HFF0000&}This would be pure, full intensity blue {\c&HFFFFFF&}This would be white {\c&HA0A0A&}This would be dark grey \1c&Hbbggrr&, \2c&Hbbggrr&, \3c&Hbbggrr&, \4c&Hbbggrr& to set specific colors. \1a&Haa&, \2a&Haa&, \3a&Haa&, \4a&Haa& to set specific alpha channels. \alpha defaults to \1a |
| \a<alignment> | <alignment> is a number specifying the onscreen alignment/positioning of a subtitle. A value of 1 specifies a left-justified subtitle A value of 2 specifies a centered subtitle A value of 3 specifies a right-justified subtitle Adding 4 to the value specifies a "Toptitle" Adding 8 to the value specifies a "Midtitle" 0 or nothing resets to the style default (which is usually 2) {\a1}This would be a left-justified subtitle {\a2}This would be a centered subtitle {\a3}This would be a right-justified subtitle {\a5}This would be a left-justified toptitle {\a11}This would be a right-justified midtitle Only the first appearance counts. |
| \an<alignment> | numpad layout Only the first appearance counts. |
| \k<duration> | <duration> is the amount of time that each section of text is highlighted for in a dialogue event with the Karaoke effect. The durations are in hundredths of seconds. eg. {\k94}This {\k48}is {\k24}a {\k150}karaoke {\k94}line \k<duration> highlight by words \kf or \K<duration> fill up from left to right \ko<duration> outline highlighting from left to right |
| \q<num> | <num> wrapping style |
| \r[<style>] | This cancels all previous style overrides in a line <style> restores to <style> instead of the dialogue line default. |
| \t([<t1>, <t2>, ][<accel>, ]<style modifiers>) | <t1>, <t2> Animation beginning, ending time offset [ms] (optional) <accel> Modifies the linearity of the transformation (optional) The following calculation is performed to get the coefficient needed to interpolate between the given style modifiers: pow((t-t1)/(t2-t1), accel), where t is the time offset for the subtitle.
The meaning of <accel>: 1: the transformation is linear between 0 and 1: will start fast and slow down greater than 1: will start slow and get faster As an example, using 2 will make growing the letters (by {\fscx200\fscy200}) look linear rather than slowering. <style modifiers> Any style modifier which can be animated: \c,\1-4c,\alpha,\1-4a,\fs,\fr,\fscx,\fscy,\fsp,\bord,\shad,\clip (only the rectangular \clip) |
| \move(<x1>, <y1>, <x2>, <y2>[, <t1>, <t2>]) | <x1>, <y1> The coordinate to start at. <x2>, <y2> The coordinate to end at. <t1>, <t2> Animation beginning, ending time offset [ms] (optional) The origin of the movement is defined by the alignment type. |
| \pos(<x>, <y>) | Defaults to \move(<x>, <y>, <x>, <y>, 0, 0) |
| \org(<x>, <y>) | Moves the default origin at (x,y). This is useful when moving subtitles in the direction of rotation. |
| WARNING: \t, \move and \pos will ignore collusion detection. | |
| \fade(<a1>, <a2>, <a3>, <t1>, <t2>, <t3>, <t4>) | <a1> Alpha value before <t1> <a2> Alpha value between <t2> and <t3> <a3> Alpha value after <t4> <t1>, <t4> Animation beginning, ending time offset [ms] <t1> - <t2> Alpha value will be interpolated between <a1> and <a2> <t2> - <t3> Alpha value will be set to <a2> <t3> - <t4> Alpha value will be interpolated between <a2> and <a3> |
| \fad(<t1>, <t2>) | <t1> the time length of fading in <t2> the time length of fading out |
| \clip(<x1>, <y1>, <x2>, <y2>) | Clips any drawing outside the rectangle defined by the parameters. |
| \clip([<scale>,] <drawing commands>) | Clipping against drawn shapes. <scale> has the same meaning as in the case of \p<scale> |
| \p<scale> | <scale> Turns on drawing mode and sets the magnification level of the coordinates at the same time. Scale is interpreted as two to the power of (<scale> minus one). For example {\p4} and the coordinate (8,16) will mean the same as {\p1} and (1,2). This feature can be useful for sub-pixel accuracy. If 0, drawing mode is turned off and the text is interpreted as usual. |
| \pbo<y> | <y> baseline offset. By default any drawings are positioned on the current baseline. With this value it is possible to move them up or down by <y> pixels. (up: y<0, down: y>0) |
| Drawing commands: | |
| m <x> <y> | Moves the cursor to <x>, <y> |
| n <x> <y> | Moves the cursor to <x>, <y> (unclosed shapes will be left open) |
| l <x> <y> | Draws a line to <x>, <y> |
| b <x1> <y1> <x2> <y2> <x3> <y3> | 3rd degree bezier curve to point 3 using point 1 and 2 as the control points |
| s <x1> <y1> <x2> <y2> <x3> <y3> .. <xN> <yN> | 3rd degree uniform b-spline to point N, must contain at least 3 coordinates |
| p <x> <y> | extend b-spline to <x>, <y> |
| c | close b-spline |